<template>
  <div class="hello">
    
    <h3 @click="add">点击我改变数据</h3>
    <ul>
      <li><a href="https://router.vuejs.org" target="_blank" rel="noopener">{{this.$store.getters('getname')}}</a></li>
    
    </ul>
  </div>
</template>

<script>
	import Vue from 'vue'
export default {
  name: 'HelloWorld',
  props: {
    msg: String
  },
  methods:{
	add(){
		this.$store.dispatch('cg')
	}  
  },
  created(){
	  console.log('ffss')
	  console.log(this.$store.state.name)
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
  margin: 40px 0 0;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>
